﻿using System.Linq;
using PlatformNetCore.Entity;
using Webdiyer.AspNetCore;
using System.Linq.Expressions;
using System;
using PlatformNetCore.IRepository;

namespace PlatformNetCore.Repository
{
    public class MenuRepository : Repository<Menu>, IMenuRepository
    {
        public MenuRepository(PlatformContext dbContext) : base(dbContext)
        {

        }
        public override PagedList<Menu> GetPagedList(int pageIndex, int pageSize, Expression<Func<Menu, bool>> predicate)
        {
            return _dbContext.Menu.Where(predicate).OrderBy(m => m.SortNo).ToPagedList(pageIndex, pageSize);
        }
    }
}
